package org.domain.acount.entity;

// Generated 24/10/2009 23:46:06 by Hibernate Tools 3.2.4.GA

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.GeneratedValue;
import javax.persistence.Query;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.In;

/**
 * Usuario generated by hbm2java
 */
@Entity
@Table(name = "usuario", catalog = "acount")
public class Usuario implements java.io.Serializable {

	@In EntityManager entityManager;
	private String username;
	private String nome;
	private String email;
	private String senha;
	private Boolean desabilitado;
	private List papeis;
	

	public Usuario() {
	}

	public Usuario(String nome, String username, String email, String senha) {
		this.username = username;
		this.nome = nome;
		this.email = email;
		this.senha = senha;
	}

	public Usuario(String nome, String username, String email, String senha,
			Boolean desabilitado) {
		this.nome = nome;
		this.username = username;
		this.email = email;
		this.senha = senha;
		this.desabilitado = desabilitado;
	}

	@Id
	@Column(name = "username", unique = true, nullable = false)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "nome", nullable = false, length = 80)
	@NotNull
	@Length(max = 80)
	public String getNome() {
		return this.nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	@Column(name = "email", nullable = false, length = 100)
	@NotNull
	@Length(max = 100)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "senha", nullable = false, length = 32)
	@NotNull
	@Length(max = 32)
	public String getSenha() {
		return this.senha;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

	@Column(name = "desabilitado")
	public Boolean getDesabilitado() {
		return this.desabilitado;
	}

	public void setDesabilitado(Boolean desabilitado) {
		this.desabilitado = desabilitado;
	}

	@Transient
	public List<Papel> getPapeis() {
    	return papeis;
	}
	
	public void setPapeis(List papeis) {
		this.papeis = papeis;
	}

}
